<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="tags" tagdir="/WEB-INF/tags"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%><head>
	<title><fmt:message key="book" /></title>
</head>
<body>
	<c:url value="/domain/book/update/${book.primaryKey}" var="updateUrl"/>
	<form:form action="${updateUrl}" modelAttribute="book" method="POST">
		<form:errors cssClass="error"/>
		<table class="edit">
			<form:hidden path="bookId"/>
			<form:hidden path="version"/>
			<tbody>
				<tr>
					<th><fmt:message key="book_accountId" /> <em>*</em></th>	
					<td>
						<spring:bind path="book.owner">
							<spring:transform value="${book.owner}" var="owner"/>
						</spring:bind>
						<tags:a href="/domain/account/show/${book.owner.primaryKey}" text="${owner}" cssClass="ajaxLink"/>
						<form:errors path="owner" cssClass="error"/>
					</td>
				</tr>
				<tr class="odd">
					<th><fmt:message key="book_title" /> <em>*</em></th>	
					<td>
						<form:input path="title" cssClass="required {maxlength: 255}"/>
						<form:errors path="title" cssClass="error"/>
					</td>
				</tr>
				<tr>
					<th><fmt:message key="book_numberOfPages" /> <em>*</em></th>	
					<td>
						<form:input path="numberOfPages" cssClass="number required"/>
						<form:errors path="numberOfPages" cssClass="error"/>
					</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="2">
						<tags:button type="submit" key="crud.save.button" icon="save"/>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<tags:a href="/domain/book/show/${book.primaryKey}" key="crud.show.button" cssClass="ajaxLink" icon="ok"/>
						<tags:a href="/domain/book/createForm" key="crud.create.button" cssClass="ajaxLink" icon="add"/>
						<tags:a href="/domain/book/delete/${book.primaryKey}" key="crud.delete.button" cssClass="ajaxModal" icon="delete"/>
					</td>
				</tr>
			</tfoot>
		</table>
	</form:form>
</body>
